chore: move content from fe-lib#977
Conversation
There was a problem hiding this comment.
Pull request overview
This PR moves shared utilities, types, constants, and components from fe-lib to the main codebase, organizing them into the appropriate directories under src/Pages-Devtron-2.0/Shared/ and adding utility files to src/Shared/.
Key Changes:
- Added shared types (enums for time windows, prod/non-prod selection) and chart tooltip types
- Added shared constants for pagination, time windows, and sorting options
- Added shared React components for loading states and chart tooltips
- Added new route constants for overview pages (apps, workflow, DORA metrics, pipeline insights)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Shared/utils.ts |
Adds parseTimestampToDate utility function for date formatting |
src/Pages-Devtron-2.0/Shared/utils.ts |
Adds parseTimestampToDate utility function (duplicate of above) |
src/Pages-Devtron-2.0/Shared/types.ts |
Defines shared types and enums for time windows and chart tooltips |
src/Pages-Devtron-2.0/Shared/constants.ts |
Defines pagination options, time window labels, and sorting configurations |
src/Pages-Devtron-2.0/Shared/components.tsx |
Implements reusable chart components (loading state, tooltip, color indicator) |
src/Pages-Devtron-2.0/Shared/index.ts |
Exports all shared modules for Pages-Devtron-2.0 |
src/Pages-Devtron-2.0/index.ts |
Adds export for new Shared module |
src/Common/Constants.ts |
Adds route constants for new overview pages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| export const parseTimestampToDate = (timestamp: string): string => { | ||
| const dateObj = dayjs(timestamp) | ||
| return dateObj.format(DATE_TIME_FORMATS.DD_MMM) | ||
| } |
There was a problem hiding this comment.
The parseTimestampToDate function is duplicated in both src/Shared/utils.ts and src/Pages-Devtron-2.0/Shared/utils.ts. This creates code duplication and maintenance overhead. Consider keeping the function in only one location (preferably src/Shared/utils.ts as it's more general) and importing it from there when needed in Pages-Devtron-2.0.
| export const parseTimestampToDate = (timestamp: string): string => { | |
| const dateObj = dayjs(timestamp) | |
| return dateObj.format(DATE_TIME_FORMATS.DD_MMM) | |
| } | |
| import { parseTimestampToDate } from '../../../Shared/utils' |
| export const parseTimestampToDate = (timestamp: string): string => { | ||
| const dateObj = dayjs(timestamp) | ||
| return dateObj.format(DATE_TIME_FORMATS.DD_MMM) | ||
| } |
There was a problem hiding this comment.
The parseTimestampToDate function is duplicated in both src/Shared/utils.ts and src/Pages-Devtron-2.0/Shared/utils.ts. This creates code duplication and maintenance overhead. Consider keeping the function in only one location (preferably here in src/Shared/utils.ts as it's more general) and importing it when needed in Pages-Devtron-2.0.
|
|
||
| import { ChartTooltipProps } from './types' | ||
|
|
||
| export const LoadingDonutChart = () => ( |
There was a problem hiding this comment.
These can go in global Shared itself
… SelectPickerTextArea component logic.
… navigation types
refactor: Extract navigation types into a dedicated module and refine…
fix: remove 'isAvailableInEA' from subItems type definition in Naviga…
…t for layout consistency
fix: update class name from 'flex' to 'flexbox' in InfoBlock component
…n-labs/devtron-fe-common-lib into feat/oss-overviews
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist